import Vue from 'vue'
import VueRouter from 'vue-router'
// import System from './system'
// import Commodity from './commodity'
// import Process from './process'
// import Chuxiu from './chuxiu'
import PreManager from './premanager'
import MissionManager from './missionmanager'

// 解决element Ui 导航中vue-router 在 3.0 版本以上 重复点击菜单报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: () => import(/* webpackChunkName: "login" */ '../views/login/index.vue')
  },
  PreManager,
  MissionManager
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
